﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace myFarm
{
    class Farm : Drawable
    {
        Random r = new Random();
        Ground[,] map;

        public Farm(int size_x, int size_y, Ground[,] map)
            : base(drawable_type.farm)
        {
            this.map = new Ground[size_x, size_y];
            for (int i = 0; i < size_x; i++)
            {
                for (int j = 0; j < size_y; j++)
                {
                    if (r.Next(1, 3) == 1)
                        map[i, j] = new Ground(new Vector2(i * 10, j *10), drawable_type.grass);
                    else
                        map[i, j] = new Ground(new Vector2(i * 10, j * 10), drawable_type.dirt); 
                }
            }
        }

        public void addAnimal()
        {
            int X = r.Next(0, 9);
            int Y = r.Next(0, 9);

            if (r.Next(1, 2) == 1)
                map[X, Y].Containing = new Pony(X * 10, Y * 10);
            else
                map[X, Y].Containing = new Hen(X * 10, Y * 10);

        }
    }
}
